<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
    $(function(){
	var page=1;
	$("#accordion").accordion({
		heightStyle: "content"
	});
	$("#viewMore").click(function(){
		page++;
		$.ajax({
			type:"post",
			url:"gallery.do",
			data:"mode=listByUser&uid=${param.uid }&page="+page,
			success:function(jsonData){
				var tag="";
				console.log(jsonData);
				$.each(jsonData.list,function(i,list){
					tag+="<h3><img src=/img/thumb_gal/"+list.thumbImgName+"></h3>";
					tag+="<div><p><b>title : "+list.title+"</b></p><p><img src=/img/upload_gal/"+list.orgImgName+" width=90%></p>";
					tag+="<p>"+list.contents+"</p><p style='font-size: 9px;'>"+list.w_date+"  추천수: "+list.wow+"</p></div>";
				});
				$("#accordion").append(tag).accordion('destroy').accordion({heightStyle:"content"});
			}
		});
	});
});
</script>
<a href="sns.do?mode=insert&uid=${sessionScope.mvo.uId }&fid=${param.uid }">친구 추가</a>
<div id="accordion">
	<c:forEach items="${requestScope.list }" var="list">
		<h3><img src="/img/thumb_gal/${list.thumbImgName }"></h3>
		<div>
			<p><b>title : ${list.title }</b></p>
			<p><img src="/img/upload_gal/${list.orgImgName }" width="90%"></p>
			<p>${list.contents }</p>
			<p style="font-size: 9px;">${list.w_date }  추천수:${list.wow }</p>
		</div>
	</c:forEach>
</div>
<div id="viewMore" align="center" style="border:1px; border-style:solid; border-color:white; width:150px;height:30px; margin: auto;">더 보기</div>